import {Component, OnInit} from '@angular/core';
import {Observable} from 'rxjs/Rx';
import {BladeData} from '../../../shared/blade/blade-data';
import {Blade} from '../../../shared/blade/blade.model';
import {BladeService} from '../../../shared/blade.service';
import {CircuitListComponent} from './circuit-list/circuit-list.component';

import {ToolbarService} from '../../../shared/toolbar.service';
import {SetofkeyService} from '../../../service/setofkey.service';
import {DialogService} from '../../../shared/dialog.service';
import {BladeContainerInterface} from '../../../shared/blade/blade-container.interface';

@Component({
  selector: 'app-circuit',
  templateUrl: './circuit.component.html',
  styleUrls: ['./circuit.component.css'],
  providers: [BladeService]
})
export class CircuitComponent implements OnInit {

  /**
   * 当前弹出层
   *
   * @type {Blade}
   * @memberof BladeContainerInterface
   */
  currentBlade: Blade;

  constructor(public bladeService: BladeService,) {
  }

  ngOnInit() {
    this.createBlade();
  }

  /**
   * 创建风机线路列表弹出层
   *
   *
   * @memberof DicComponent
   */
  createBlade() {
    let data: BladeData = new BladeData();
    data.id = 'CircuitList';
    data.title = '风机线路';
    data.subtitle = '风机线路列表';
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(CircuitListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }

  /**
   * 是否可以离开
   *
   *
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}


// WEBPACK FOOTER //
// ./src/app/module/basic/circuit/circuit.component.ts
